package com.example.secondservice.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;

@RestController
@RequestMapping(value = "/consumer")
public class SecondController {
    @GetMapping(value = "/message")
    public String consumerMessage(HttpServletRequest request){
        Enumeration<String> names = request.getHeaderNames();
        while (names.hasMoreElements()) {
            System.err.println(names.nextElement());
        }
        return "Hello JavaInUse Called in Second Service";
    }
}
